package test2_annonation.impl;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import test2_annonation.BookService2;


//使用纯注解模式进行开发
public class test {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext acac=new AnnotationConfigApplicationContext(SpringConfig.class);
        BookService2 bs2 = acac.getBean(BookService2.class);
        //这里的bs2，是代理类，从而实现aop
        System.out.println(bs2.getClass());
        bs2.save();

        //默认 单例
        /*BookDao2Impl bean = acac.getBean(BookDao2Impl.class);
        BookDao2Impl bean2 = acac.getBean(BookDao2Impl.class);
        System.out.println(bean);
        System.out.println(bean2);*/

    }
}
